﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="RequestDemo_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        获取当前执行请求相对于应用根目录的虚拟路径，以~开头:<br />
        Request.AppRelativeCurrentExecutionFilePath:<br />
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
        <br />
        <br />
        获取当前应用的物理路径:<br />
        Request.PhysicalApplicationPath:<br />
        <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
        <br />
        <br />
        获取当前请求的物理路径:<br />
        Request.PhysicalPath:<br />
        <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
        <br />
        <br />
        网页的来源，全局防盗链用 Globals.asax:<br />
        Request.UrlReferrer:<br />
        <asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
        <br />
        <br />
        Request.UserHostAddress获得访问者的IP地址:<br />
        <asp:Label ID="Label5" runat="server" Text="Label"></asp:Label>
        <br />
        <br />
        Request.UserLanguages获得访问者浏览器支持的语言:<br />
        <asp:Label ID="Label6" runat="server" Text="Label"></asp:Label>
        <br />
        <br />
        Request.Cookies 获取浏览器发过来的浏览器端的Cookie:<br />
        <asp:Label ID="Label7" runat="server" Text="Label"></asp:Label>
        <br />
        注：使用Request.Cookies 的时候一般只是读取，将Cookie 写回浏览器要用Response.Cookies。<br />
        <br />
        Request.MapPath(virtulPath)将虚拟路径转换为磁盘上的物理路径：<br />
        <asp:Label ID="Label8" runat="server" Text="Label"></asp:Label>
    
    </div>
    </form>
</body>
</html>
